package com.yanjin.test;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.yanjin.test.presenter.BasePresenter;

public abstract class BaseActivity<V,T extends BasePresenter<V>> extends AppCompatActivity {
    public T mPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = createPrensenter();
        mPresenter.attachView((V) this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mPresenter.disAttachView();
    }

    public abstract T createPrensenter();
}
